<template>
	<view>
		<component :is='curComponent' :productList='productList'></component>
	</view>
</template>

<script>
	import productListRow from '@/components/product-list-row.vue';
	import productListGird from '@/components/product-list-gird.vue';
	export default {
		name:"product-list-switch",
		data() {
			return {
				
			};
		},
		components:{
			productListRow,
			productListGird
		},
		props:{
			type:String,
			productList:Array,
		},
		computed: {
			curComponent(){
				return this.type === 'row' ? 'productListRow' : 'productListGird'
			}
		}
	}
</script>

<style lang="scss">

</style>